import os
from google.appengine.api import users
from google.appengine.ext import webapp
import home_controller as home

class Login(webapp.RequestHandler):
  def get(self):
    user = users.get_current_user()

    if user:
#      self.response.headers['Content-Type'] = 'text/plain'
#      self.response.out.write('Hello, ' + user.nickname())
      self.redirect("/home")
    else:
      self.redirect(users.create_login_url(Home.request.uri))

class Logout(webapp.RequestHandler):
    def get(selfself):
      self.redirect(users.create_login_url(Home.request.uri))        